package com.wyy.travels.dao;/*
 **
 * @author yangyang
 *@date 2022/07/21 21:44
 **/

import com.wyy.travels.entity.Province;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface ProvinceDao extends  BaseDao<Province,String> {

    @Select("select id,name,tags,placecounts from t_province order by placecounts limit  #{start},#{rows}")
    List<Province> findByPage(@Param("start") Integer start, @Param("rows") Integer rows);

    @Select(" select  count(id) from t_province")
    Integer  findToals();
    @Insert("insert into t_province values(#{id},#{name},#{tags},#{placecounts})")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    void  save(Province province);
     @Delete("delete from t_province where id = #{id}")
     void delete(String id);
     @Select(" select id,name,tags,placecounts from t_province where id =#{id}")
     Province findOne(String id);
     @Update("update t_province set name=#{name},tags=#{tags},placecounts=#{placecounts}  where id=#{id}")
     void  update(Province province);

}
